package com.bishe.bishe.Controller;

import com.bishe.bishe.Service.UnitService;
import com.bishe.bishe.pojo.Unit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/unit")
@RestController
public class UnitController {
    @Autowired
    private UnitService unitService;
    @RequestMapping("/findall")
    public List<Unit> findall(){
        return unitService.findall();
    };
    @RequestMapping("/insert")
    public int insert(@RequestBody Unit unit){
        return unitService.insert(unit);
    };

    @RequestMapping("/delete")
    public int delete(@RequestBody Unit unit){
        return unitService.delete(unit);
    };

}
